﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Client
{
    public partial class GuestPage : Form
    {
        public GuestPage()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            List<BookingService.Booking> bookings = bClient.FindBookingsByGuestId(Convert.ToInt32(txtGuestID.Text)).ToList();
            grid.DataSource = bookings;

        }
        BookingService.BookingServiceClient bClient;
        RoomTypeService.RoomTypeServiceClient rtClient;


        private void Guest_Load(object sender, EventArgs e)
        {
            bClient = new BookingService.BookingServiceClient();
            rtClient = new RoomTypeService.RoomTypeServiceClient();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            BookingService.Booking booking = bClient.FindBooking(txtBookingNumber.Text);
            MessageBox.Show("Booking Id" + booking.bookingNumber + "\n" + booking.startDate + "\n" + booking.endDate );

        }


    }
}